/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.asset.purchaseorder.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuyao.cloud.asset.dto.apply.PurchaseorderSearchDTO;
import com.fuyao.cloud.asset.entity.AssetPurchaseorder;
import com.fuyao.cloud.asset.entity.ac.AssetAcList;
import com.fuyao.cloud.asset.vo.purchaseorder.PurchaseOrderExcelVO;
import com.fuyao.cloud.asset.vo.purchaseorder.PurchaseOrderVO;
import com.fuyao.cloud.asset.vo.purchaseorder.PurchaseorderCreateVO;
import com.fuyao.cloud.common.core.util.R;

import java.util.List;

/**
 * 采购订单
 *
 * @author liyue
 * @date 2021-11-24 10:55:26
 */
public interface AssetPurchaseorderService extends IService<AssetPurchaseorder> {

	/**
	 * 创建采购订单
	 *
	 * @return 采购订单对象
	 */
	PurchaseorderCreateVO create();

	/**
	 * 编辑方法
	 *
	 * @param id 主键id
	 * @return 采购订单对象
	 */
	PurchaseorderCreateVO edit(Long id);

	/**
	 * 查询采购订单信息
	 *
	 * @param query
	 * @return
	 */
	List<PurchaseOrderExcelVO> listPurchaseOrder(QueryWrapper<AssetPurchaseorder> query);

	/**
	 * 采购订单选择page 查询
	 *
	 * @param page         page对象
	 * @param queryWrapper 查询构造器。
	 * @return page对象
	 */
	IPage<PurchaseOrderVO> getPurchaseOrderPage(Page page, QueryWrapper<AssetPurchaseorder> queryWrapper);

	/**
	 * 验收时更新已收货数量
	 *
	 * @param acList      验收清单
	 * @param batchnumber 批次号
	 */
	void updateArrivedQuantity(List<AssetAcList> acList, String batchnumber);


	IPage<AssetPurchaseorder> page(Page page, QueryWrapper<AssetPurchaseorder> query, PurchaseorderSearchDTO searchDTO);

	/**
	 * 批量删除
	 * @param ids 业务id集合
	 * @return R
	 */
    R batchDelete(List<Long> ids);

}
